Skip to content

fix(store): keep table.views in sync with store.views - #3225

Open
AndyScherzinger wants to merge 1 commit into
fix/noid/store-findindex-guardsfrom
fix/noid/view-table-alias
Open

AndyScherzinger wants to merge 1 commit into
fix/noid/store-findindex-guardsfrom
fix/noid/view-table-alias

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

store.views and table.views start out holding the same view objects, so writing to one used to be visible through the other. setView broke that by replacing the entry in store.views with the object the server returned, leaving table.views on the old one. From the first rename onwards the two collections hold different data.

What that looks like in the app:

  • Rename a view and every place that reads store.views shows the new title, while the navigation entry under its table — which reads table.views — keeps the old one until a page reload.
  • Delete a view and it disappears from store.views only. The navigation still lists it, and Dashboard.vue builds its per-view share counts from table.views, so it calls .filter() on the columns of a view that is gone.

Both writes are now mirrored into the parent table inside setView and removeView, so every caller gets the sync instead of each one repeating it.

Verified against a running instance before and after: renaming a view used to leave store.views reading Board RENAMED while table.views still read Board, and a deleted view stayed in table.views.

Based on #3219, which rewrote setView — please merge that first.

🖼️ Screenshots

Not applicable, no visual change beyond the navigation entry showing the correct title.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The navigation renders a table's views from table.views, while most of
the app reads store.views. Both start out holding the same view objects,
but setView replaces the entry in store.views with the object the server
returned and leaves table.views pointing at the old one, so the two
collections diverge on the first rename.

Visible effects:

- Renaming a view updates the title everywhere except the navigation
  entry below its table, which keeps the old title until a reload.
- Deleting a view removes it from store.views only. The navigation still
  lists it, and Dashboard.vue reads table.views to build the per-view
  share counts, so it then calls .filter() on the columns of a view that
  no longer exists.

Mirror both writes in the parent table inside setView and removeView, so
every caller gets the sync rather than each one repeating it.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant